package com.zzyl.nursing.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzyl.common.core.page.PageDomain;
import com.zzyl.nursing.service.MemberOrdersService;

import com.zzyl.nursing.vo.NursingProjectPageVo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MemberOrdersServiceImpl implements MemberOrdersService {
    @Resource
    private INursingProjectService nursingProjectService;
    @Override
    public NursingProjectPageVo queryPageNursingProject(PageDomain pageDomain) {
        Page<NursingProject> page = Page.of(pageDomain.getPageNum(), pageDomain.getPageSize());
        page = nursingProjectService.page(page);
//        List<NursingProject> nursingProjects = page.getRecords();
        return new NursingProjectPageVo(page.getTotal(),page.getRecords());
    }

    @Override
    public NursingProject selectNursingProjectById(Long id) {
        NursingProject project = nursingProjectService.getById(id);
        return project;
    }
}
